1. Field of the Invention
The present invention relates to an image processing apparatus and an image processing method.
2. Description of the Related Art
Image forming apparatuses, such as a printer, temporarily store input image data in a memory, and read the image data stored in the memory at a predetermined timing to perform printing operations. In this case, if the image data is to be stored in the memory without any change, a large-capacity memory is required, thereby increasing the cost. Therefore, typically, input image data is stored in a memory in a manner compressed and encoded.
Japanese Patent No. 4000266, for example, discloses a technology for performing compression encoding by using the Lempel-Ziv (LZ) 77 algorithm. More specifically, in a slide storage unit that stores therein input data, a data array that is composed of previous consecutive image data and that is identical to an input data array composed of image data sequentially input is searched for, and the identical information thereof (position information, length, and the like) is to be encoded.
An assumption is made on the case where a prediction error value, which is difference between the pixel value of a pixel to be encoded (referred to as a “target pixel”) and the prediction pixel value of the target pixel obtained from pixel values of surrounding pixels that surround the target pixel, is employed as input data. In this case, if the prediction error value thus input is identical to a prediction error value that has been already stored in the slide storage unit, list search processing is performed in the slide storage unit, and information of the list thus searched for is encoded. The list search processing is a processing for searching for a data array that is composed of previous consecutive prediction error values and that is identical to an input data array composed of prediction error values sequentially input. By contrast, if the prediction error thus input is not identical to the prediction error value that has been already stored in the slide storage unit, the prediction error value thus input is to be encoded.
The prediction error value is not always a positive value and can be a negative value. As a result, there is a problem in that the number of bits required for encoding the prediction error value is increased, whereby a sufficient compression ratio cannot be achieved.